import { useReactive } from "ahooks";
import { useModel } from "umi";
import { useEffect } from "react";
import compress from "gql-compress";

const useAllHomepageNotings = () => {
    const { graphqlFetch } = useModel("global");

    const state = useReactive({
        homepageNotingsLoading: false,
        homepageNotings: [],
    });

    const loadAllHomepageNotings = async () => {
        state.homepageNotingsLoading = true;
        // let res = await graphqlFetch({
        //     query,
        //     variables: {},
        // });
        // let Notings = res?.a?.nodes || [];
        let homepageNotings = [0, 1, 3, 3, 3, 3, 3]
        state.homepageNotings = homepageNotings;
        state.homepageNotingsLoading = false;
        // return Notings;
    };

    return { ...state, loadAllHomepageNotings };
};

const query = compress(``);

export default useAllHomepageNotings;
